package com.mky.mkcompany.service;

import com.alibaba.fastjson.JSONObject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Lenovo on 2017/9/1.
 */
@Service
public class TestService {
    private final Logger LOGGER = LoggerFactory.getLogger(getClass());

    /**
     * 分页获取获取公司信息
     */
    public JSONObject findCompanyInfos(int page , int size){
        JSONObject res = new JSONObject();
//        Pageable pageable = new PageRequest(page-1, size, null);
//        Query query=new Query();
//        query.with(pageable);
//        LOGGER.info("query="+query);
//        long total= companyInfoDao.findObjectNum(new Query());
//        //List<JSONObject> companys= companyInfoDao.findObjects(query);
//        List<CompanyInfo> companys= companyInfoDao.findCompanyInfos(query);
//        res.put("items",companys);
//        res.put("total",total);
        return res;
    }
}
